Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type handling and resolve #339 #348

Merged
merged 9 commits into from
Aug 28, 2024

Conversation

akeeste
Copy link
Contributor

@akeeste akeeste commented Aug 15, 2024

This PR resolves #339. It makes some improvements to the type handling, especially in the wave module, by allowing convert_to_dataarray to take in multivariate xr.datasets and pd.dataframes

Another larger PR to better utilize this improved type handling in the wave module will come after.

@akeeste akeeste requested a review from ssolson August 15, 2024 21:10
Copy link
Contributor

@ssolson ssolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this @akeeste. Just a couple of question before we finish this up.

mhkit/utils/type_handling.py Outdated Show resolved Hide resolved
@akeeste
Copy link
Contributor Author

akeeste commented Aug 27, 2024

@ssolson I added wrapped up the last things on this PR:

  • added the requirement on xarray dataset inputs to the docstring
  • recapping our meeting discussion here for reference: the convert_to_dataarray parameter name is an attribute of the DataArray. It is the name of the variable that the DataArray represents. If the DataArray is converted to a Dataset, it automatically becomes the label of that data in the Dataset. This is different than the "variable" dimension which is created when a multivariate Dataset is converted to a DataArray.
  • confirmed that wave_example.ipynb now works as intended

@akeeste
Copy link
Contributor Author

akeeste commented Aug 27, 2024

@ssolson tests are passing and all review comments were addressed. I'll merge and continue working to speed up xarray inputs in the wave module

@ssolson ssolson merged commit 789cc06 into MHKiT-Software:develop Aug 28, 2024
39 checks passed
@akeeste akeeste deleted the improve_type_handling branch August 28, 2024 14:32
@ssolson ssolson mentioned this pull request Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants